﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Common;

namespace VMS_Web
{
    public partial class MainMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        public void MessageToDisplay(MessageType messageType, string message)
        {
            if (MessageType.Error == messageType)
            {
                diverror.Attributes["class"] = "alert alert-danger show";
                messagetodisplay.InnerText = message;
                
            }
            else if (MessageType.Success == messageType)
            {
                diverror.Attributes["class"] = "alert alert-success show";
                messagetodisplay.InnerText = message;
            }
            else if (MessageType.Warning == messageType)
            {
                diverror.Attributes["class"] = "alert alert-warning show";
                messagetodisplay.InnerText = message;
            }
            else if (MessageType.Information == messageType)
            {
                diverror.Attributes["class"] = "alert alert-info show";
                messagetodisplay.InnerText = message;
            }
            else
            {
                diverror.Attributes["class"] = "hidden";
                messagetodisplay.InnerText = "";
            }
        }


        public void MessageToDisplay(MethodResult methodResult)
        {
            if (MessageType.Error == methodResult.EnmMessageType)
            {
                diverror.Attributes["class"] = "alert alert-danger show";
                messagetodisplay.InnerText = methodResult.Message;

            }
            else if (MessageType.Success == methodResult.EnmMessageType)
            {
                diverror.Attributes["class"] = "alert alert-success show";
                messagetodisplay.InnerText =  methodResult.Message;
            }
            else if (MessageType.Warning == methodResult.EnmMessageType)
            {
                diverror.Attributes["class"] = "alert alert-warning show";
                messagetodisplay.InnerText =  methodResult.Message;
            }
            else if (MessageType.Information == methodResult.EnmMessageType)
            {
                diverror.Attributes["class"] = "alert alert-info show";
                messagetodisplay.InnerText =  methodResult.Message;
            }
            else
            {
                diverror.Attributes["class"] = "hidden";
                messagetodisplay.InnerText = "";
            }
        }
    }

    
}